<template>
  <div class="generate-chart">
    <Material v-if="isEmpty" :config="config" />
    <el-empty v-else description="暂无数据"></el-empty>
  </div>
</template>

<script>
import Material from './Material'

export default {
  name: 'GenerateChart',
  components: {
    Material
  },
  provide: {
    flag: 'Generate'
  },
  props: {
    config: {
      type: Object,
      default: () => {}
    }
  },
  computed: {
    isEmpty() {
      if (this.config && JSON.stringify(this.config) !== '{}') {
        return true
      }
      return false
    }
  }
}
</script>

<style lang="scss" scoped></style>
